﻿using System.Reflection;
using System.Xml;

namespace WeAppsCenter.Core;
public class CheckForSoftwareUpdates
{

    //提取前三位版本号
    public static readonly string LocalVersion = "3.0.3";
    public static bool GetIfNewerVersion()
    {
        if (GetNewVersion() != LocalVersion)
        {
            return true;
        }

        return false;
    }
    public static string NewVersion => GetNewVersion();
    public static string GetNewVersion()
    {
        XmlDocument xmlDocument = new XmlDocument();
        WeGet.Apps apps = new WeGet.Apps(Settings.DataDirectory);
        xmlDocument.Load(apps.RepositoryDirectory);
        return xmlDocument.DocumentElement.Attributes["version"].Value;
    }
}
